package fr.neyb.wesb.core.data.content.impl.sb;

import fr.neyb.framework.util.CBString;
import fr.neyb.wesb.core.data.content.TextableField;
import fr.neyb.wesb.core.data.content.impl.AbstractField;
import fr.neyb.wesb.core.data.descriptors.field.FieldDescriptor;
import fr.neyb.wesb.core.data.descriptors.field.impl.TextFieldDescriptor;

public class SBField extends AbstractField implements TextableField {
	private String content;

	public SBField(String content, FieldDescriptor fieldDescr) {
		super(fieldDescr);
		if (!(fieldDescr instanceof TextFieldDescriptor))
			throw new IllegalAccessError();
		this.content = content;
	}

	@Override
	public String toString() {
		return content;
	}

	@Override
	public CBString toCBString() {
		return new CBString(content);
	}
}
